package cloudspace.vm.javassist;

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javassist.CtClass;
import javassist.CtMethod;

public class ClassOutline
{
	public Map<String,CtMethod> declaredMethods;
	public ClassOutline(CtClass myClazz)
	{
		declaredMethods = new HashMap<String,CtMethod>();
		outline(myClazz);
	}
	private void outline(CtClass clazz)
	{
		//System.out.println("\nAnalyzing "+ clazz.getName());
		for(CtMethod method : clazz.getDeclaredMethods())
		{
			declaredMethods.put(method.getName(), method);
		}
	}
	public boolean isDeclared(String methodName)
	{
		if(declaredMethods.get(methodName) == null)
			return false;
		return true;
	}
}
